<template>
  <div>
    <div>
      <van-nav-bar title="订单详情" left-text="返回" left-arrow :fixed="true" @click-left="onClickLeft"/>
    </div>
    <div style="padding-left:10px;padding-top:10px;">
      <p style="font-size:14px;text-align:left;">订单编号:{{list.orderId}}</p>
      <p style="font-size:14px;text-align:left;">停车路段:{{section}}</p>
      <p style="font-size:14px;text-align:left;">泊位编号:{{berth}}</p>
      <p style="font-size:14px;text-align:left;">车牌号码:{{list.orderRemark}}</p>
      <p style="font-size:14px;text-align:left;">订单状态:{{list.orderStatus}}</p>
      <p style="font-size:14px;text-align:left;">驶入时间:{{list.orderTime}}</p>
      <p style="font-size:14px;text-align:left;">停车时长:{{list.parkingTime}}</p>
      <p style="font-size:14px;text-align:left;">订单金额:{{list.actualAmount}}</p>
    </div>
  </div>
</template>
<script>
export default {
  data() {
    return {
      list: [
        {
          orderId: "1",
          orderRemark: "qwe",
          orderStatus: "qwe",
          orderTime: "qwe",
          parkingTime: "qwe",
          actualAmount: "qwe"
        }
      ],
      section: localStorage.getItem("sectionid"),
      berth: localStorage.getItem("boid")
    };
  },
  methods: {
    onClickLeft() {
      this.$router.go(-1);
    }
  },

  created: function() {
    console.log(localStorage.getItem("boid"));
    console.log(localStorage.getItem("sectionid"));
    this.$axios({
      url: "/findAllBySectionIdAndBerthIdreturn",
      method: "get",
      params: {
        berthId: localStorage.getItem("boid"),
        roadSectionId: localStorage.getItem("sectionid")
      }
    })
      .then(res => {
        if (res.data.code == 200) {
          const multipleSelection = res.data.data;
           this.list=multipleSelection;
        }
      })
      .catch(error => {
        alert("出错了");
      });
  }
};
</script>

